package com.handmark.pulltorefresh.library;

import android.graphics.drawable.Drawable;

import com.handmark.pulltorefresh.library.internal.LoadingLayout;

import java.util.HashSet;
import java.util.Iterator;

public final class LoadingLayoutProxy implements ILoadingLayout {
    private final HashSet<LoadingLayout> mLoadingLayouts = new HashSet();

    public final void addLayout(LoadingLayout loadingLayout) {
        if (loadingLayout != null) {
            this.mLoadingLayouts.add(loadingLayout);
        }
    }

    public final void setLastUpdatedLabel(CharSequence lastUpdatedLabel) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setLastUpdatedLabel(lastUpdatedLabel);
        }
    }

    public final void setLoadingDrawable(Drawable loadingDrawable) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setLoadingDrawable(loadingDrawable);
        }
    }

    public final void setProgressDrawable(Drawable progressDrawable) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setProgressDrawable(progressDrawable);
        }
    }

    public final void setPullLabel(CharSequence pullLabel) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setPullLabel(pullLabel);
        }
    }

    public final void setRefreshingLabel(CharSequence refreshingLabel) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setRefreshingLabel(refreshingLabel);
        }
    }

    public final void setReleaseLabel(CharSequence releaseLabel) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setReleaseLabel(releaseLabel);
        }
    }

    public final void setTextColor(int colorId) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setTextColor(colorId);
        }
    }

    public final void setTheme(boolean isNightMode) {
        Iterator<LoadingLayout> iterator = this.mLoadingLayouts.iterator();
        while (iterator.hasNext()) {
            iterator.next().setTheme(isNightMode);
        }
    }
}

